
#ifndef PUB_PUB_H
#define PUB_PUB_H

#include <BasicTypes.h>
#include <QObject>
#include <ReturnCode.h>
#include "IDL_DataWriter.h"

class Q_DECL_EXPORT pub {
public:
    explicit pub(const int &id);
    ~pub();
    bool send_message(const std::string &message);
private:
    DomainParticipant *participant = NULL;
    Publisher *publisher = NULL;
    Topic *topic = NULL;
    DataWriter *writer = NULL;
    UserDataTypeDataWriter * UserDataType_writer = NULL;
    UserDataType *instance = NULL;
    ReturnCode_t retcode;
    InstanceHandle_t instance_handle = HANDLE_NIL;
    const char *type_name = NULL;
private:
    /* 删除所有实体 */
    static int publisher_shutdown(DomainParticipant *participant);


};


#endif //PUB_PUB_H
